'get-element-by-id'.replace(/-(\w)/g, function (all, w) {
    console.log(all);
    return w.toUpperCase()
})
console.log()

var re = /(\w+)\s(\w+)/;
var str = "John Smith";
var newstr = str.replace(re, "$2, $1");
console.log(newstr);


function regMethod(ws_url) {
    if (!ws_url) {
        return null
    }
    var out = ws_url.match(/\_(\d+)\_(\d+)/)
    if (!out || out.length < 3) {
        var out2 = ws_url.match(/\/(\d+)\/(\d+)/)
        if (out2) {
            // 目前这种url可以直接播放 所以可以直接return null
            out = out2
        } else {
            throw Error("url not valid")
        }
    }
    return {
        sessionId: out[1] || "",
        channelId: out[2] || ""
    }
}

// var ws_url = "ws://192.168.230.231:8080/rtp/gb_play_4_3402000548.flv"
// var ws_url = "ws://192.168.230.231:8080/44443343434/3402000548.flv"
var ws_url = ""

var obj = regMethod(ws_url)
console.log(obj);